<!-- 首页 -->
<template>
	<view class="page-container">
    <rhino-status-bar/>
    
    <ChildProfile v-if="current === 0" :data="childProfile"/>
    
    <u-tabs
      :list="list"
      :is-scroll="false"
      :current="current"
      :bar-width="150"
      @change="handleChangeTab"
    />
    
    <view class="body-wrapper">
      <view v-if="current === 0">
        <AlbumCard v-for="item in albumList" :key="item.id" :data="item"></AlbumCard>
      </view>
    </view>
	</view>
</template>

<script>
  import ChildProfile from './components/child-profile'
  import AlbumCard from './components/album-card'
  
  export default {
    components: {
      ChildProfile,
      AlbumCard,
    },
    data() {
      return {
        list: [{
          name: '成长相册'
        }, {
          name: '课堂表现'
        }, {
          name: '百折不挠'
        }, {
          name: '作品墙'
        }],
        current: 0,
        childProfile: {
          username: '小康康',
          age: '13岁6个月',
          comment: 100,
          like: 200,
          image: '/static/images/test/img.jpg',
        },
        albumList: [
          {
            datetime: '2021.06.25',
            age: '6岁7个月',
            content: '磊宝长得越来越帅了呢！',
            images: [
              '/static/images/test/img.jpg',
              '/static/images/test/img.jpg',
              '/static/images/test/img.jpg'
            ],
          }
        ],
      };
    },
    methods: {
      handleChangeTab(index) {
        this.current = index;
      }
    }
  };
</script>

<style lang="scss" scoped>
  .page-container {
    .body-wrapper {
      .course-summary-wrapper {
        padding: 32rpx;
      }
    }
  }
</style>
